package com.liao.liaowenlong.service;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class UserDB2 extends SQLiteOpenHelper {
    public UserDB2(@Nullable Context context) {
        super(context, "user0520", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table user(id Integer primary key autoincrement,username varchar(20),password varchar(30))";
        db.execSQL(sql);
        db.execSQL("insert into user(username,password) values('2222','2222')");
//        ContentValues values = new ContentValues();
//        values.put("username", "1111");
//        values.put("password", "1111");
//        db.insert("user", null, values);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
